package org.example.admin.service.impl;

import org.example.admin.dao.UserRoleDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.admin.service.UserRoleService;

import java.util.List;


@Service("userRoleService")
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleDao userRoleDao;


    @Override
    public void saveUserRoles(Long userId, List<Long> roleIds) {
        userRoleDao.save(userId, roleIds);
    }

    @Override
    public List<Long> getURoleIdsByUserId(Long userId) {
        return userRoleDao.getURoleIdsByUserId(userId);
    }

    @Override
    public void deleteByUserId(List<Long> ids) {
        userRoleDao.deleteByUserId(ids);
    }

    @Override
    public void deleteByRoleId(List<Long> ids) {
        userRoleDao.deleteByRoleId(ids);
    }
}